<html><head><title>CopyDirectory</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">CopyDirectory()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Result = <font color="#006666"><b>CopyDirectory</b></font>(SourceDirectory$, DestinationDirectory$, Pattern$ [, Mode])</blockquote>

<b>Description</b><br><blockquote>

Copy the contents of the source directory to the destination. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>SourceDirectory$</i></td>
<td width="90%"> 
The directory to copy. 

</td></tr>
<tr><td><i>DestinationDirectory$</i></td>
<td> 
The destination to copy the directory to. 

</td></tr>
<tr><td><i>Pattern$</i></td>
<td> 
A pattern identifying the files to copy. For example: "*.*" will copy any files in the directory. 
"*.exe" will copy only the .exe files. By default, a null Pattern$ ("") will copy all the files. 

</td></tr>
<tr><td><i>Mode (optional)</i></td>
<td> 
Options for the copy operation. It can be a combination of the following values: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_FileSystem_Recursive</font>: Copy the directory with all subdirectories.
  <font color="#924B72">#PB_FileSystem_Force</font>    : Overwrites the files which are protected (read-only).
</font></pre>

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

Returns nonzero if the operation was successful and zero if it failed. 

</blockquote><p><b>Remarks</b></p><blockquote>

If the target directory already exists, its content will be overwritten automatically. The 
<a href="filesize.html">FileSize()</a> function can be used to determine if the target exists or not. 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">Debug</font></b> <font color="#006666">CopyDirectory</font>("D:\Games\MyGame\", "D:\Games\Backup\", "", <font color="#924B72">#PB_FileSystem_Recursive</font>)
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="createdirectory.html">CreateDirectory()</a>, <a href="examinedirectory.html">ExamineDirectory()</a>, <a href="deletedirectory.html">DeleteDirectory()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=checkfilename.html>CheckFilename()</a> - <a href=index.html>FileSystem Index</a> - <a href=copyfile.html>CopyFile()</a> ->

</body></html>